function Z = zscores(Z)
% Returns 1-100 scores.
%
% This procedures:
% 	1. Centers each worker's scores at 0.
% 	2. Normalizes each worker's variance to 1.0.
% 	3. Stretches the scores to a 1-100 scale.
%
% Z: a matrix of scores, where the rows are subjects and columns are sentences

nsubjects  = size(Z,1);
nsentences = size(Z,2);

for i = 1:nsubjects
	mos = nanmean(Z(i,:));
	std = nanstd(Z(i,:));
	Z(i,:) = (Z(i,:) - mos) ./ std;
	Z(i,:) =  Z(i,:) + 3.5;
%	Z(i,:) = (Z(i,:) - nanmin(Z(i,:))) / (nanmax(Z(i,:)) - nanmin(Z(i,:)));
%	Z(i,:) =  Z(i,:) * (5-1) + 1;
end

